package android.slc.user.ui.user.adapter

import android.slc.appbase.utils.GlideUtils
import android.slc.extras.user.entity.UserInfo
import android.slc.user.R
import com.bumptech.glide.Glide
import com.chad.library.adapter.base.viewholder.BaseViewHolder

/**
 * @author slc
 * @date 2020-08-24 16:18
 */
class UserInfoBrowserProvider {

    fun convert(holder: BaseViewHolder, item: UserInfo) {
        holder.setText(R.id.tv_title, item.nickName)
        holder.setText(R.id.tv_content, item.dept?.deptName)
        Glide.with(holder.itemView.context)
            .load(item.avatar)
            .apply(GlideUtils.getHeadRequestOptions())
            .into(holder.getView(R.id.iv_user_avatar))
    }

}
